package com.nai365.nart.search.api.feign;

import com.nai365.nart.common.core.constant.SecurityConstants;
import com.nai365.nart.common.core.constant.ServiceNameConstants;
import com.nai365.nart.common.core.es.SkuEsModel;
import com.nai365.nart.common.core.es.SpuEsModel;
import com.nai365.nart.common.core.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Description:
 * @Created: with IntelliJ IDEA.
 * @author: baogsbaogs
 * @createTime: 2021-03-06 17:12
 **/

@FeignClient(ServiceNameConstants.SEARCH_SERVICE)
public interface SearchFeignService {

    @PostMapping(value = "/search/save/product")
    public R productStatusUp(@RequestBody List<SpuEsModel> skuEsModels, @RequestHeader(SecurityConstants.FROM) String from);
    @PostMapping(value = "/list_search_spus_stat_inner")
    public R listSearchSpusStatInner(@RequestBody List<Long> spuIds, @RequestHeader(SecurityConstants.FROM) String from);

    @GetMapping(value = "/search_update/down")
    public Long productDown(@RequestParam("spuId") Long spuId, @RequestHeader(SecurityConstants.FROM) String from);
    @GetMapping(value = "/list_search_sku_stat_inner")
    public R getSkuStat(@RequestParam("spuId") Long spuId, @RequestParam("type")Integer type,@RequestHeader(SecurityConstants.FROM) String from);
    @GetMapping(value = "/list_search_sku_info_inner")
    public R getSkuInfo(@RequestParam("skuId") Long skuId, @RequestParam("type")Integer type,@RequestHeader(SecurityConstants.FROM) String from);
    @PostMapping(value = "/search/save/sku_up")
    public R productSkuUp(@RequestBody List<SkuEsModel> skuEsModels, @RequestHeader(SecurityConstants.FROM) String from);

    @GetMapping(value = "/search_update/down_sku")
    public Long productSkuDown(@RequestParam("skuId") Long skuId, @RequestHeader(SecurityConstants.FROM) String from);

}
